<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">

<section class="content-header">
    <h1>工艺路线查询</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <input type="hidden" th:value="${proCode}" name="proCode">
                                <input type="hidden" th:value="${special}" name="special">
                                <input type="hidden" th:value="${part}" name="part">
                                <input type="hidden" th:value="${typeId}" name="typeId">
                                <div class="form-group">
                                    <label for="query-drawNo">图号</label>
                                    <input id="query-drawNo" type="text" name="drawNo" class="form-control"
                                           placeholder="请输入图号">
                                </div>
                                <div class="form-group">
                                    <label for="query-drawName">图名</label>
                                    <input id="query-drawName" type="text" name="drawName" class="form-control"
                                           placeholder="请输入图名">
                                </div>
                                <button type="button" class="btn btn-success" id="btn-search"
                                        onclick="js.table.search(table)">
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let table;

    $(function () {

        /** 主表 */
        table = js.table.init({
            url: ctx + "summary/craRoute/list",
            exportDataType: 'all',
            exportOptions : {
                ignoreColumn: [10]
            },
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "项目编号", field: 'prodNo'},
                {title: "项目名称", field: 'proName'},
                {title: "项目数量", field: 'proNum'},
                {title: "类型", field: 'special'},
                {title: "部分", field: 'part'},
                {title: "图号", field: 'drawNo'},
                {title: "图名", field: 'drawName'},
                {title: "零件数量", field: 'drawNum'},
                {title: "重量", field: 'weight'},
                {title: "路线", field: 'route', align: 'left', halign: 'center'},
                {
                    title: "操作",
                    // width: '160px',
                    formatter: function (value, row) {
                        debugger
                        let actions = [];
                        actions.push('<a class="btn btn-info btn-xs" target="_blank" href="' + ctx +
                            'task/productionListView/selectCard/' + row.id + '"> 查看</a>');
                        return actions.join('');
                    }
                }
            ]
        });

    });
</script>
</body>
</html>
